printing patterns in python